package day04


/**
  * [B <% A] ViewBound
  */
class ViewBoundDemo [T <% Ordered[T]]{
  def select (first:T,second:T):T = {
    if (first > second) first else second
  }

}
object ViewBoundDemo{
  def main(args: Array[String]): Unit = {
    import MyPredef.selectGirl
    val viewBound: ViewBoundDemo[OrderedGirl] = new ViewBoundDemo[OrderedGirl]
    val jingjing = OrderedGirl("jingjing",26,100)
    val meimei = OrderedGirl("meimei",24,100)
    val resultGirl = viewBound.select(jingjing,meimei)
    println(resultGirl)
  }
}
